package lapsnake.model.stmt;

import lapsnake.model.*;
import lapsnake.model.data.*;
import lapsnake.py.ast.ASTHelperFactory; import java.beans.PropertyVetoException;

import org.python.antlr.ast.*;

/**Wrapper class with helper functions for AugAssign nodes*/
public class LapAugAssign extends LapStatement {
	public final SingleChild<LapExpression> target = new SingleChild<>(this, LapExpression.class);
	public final VetoableProperty<operatorType> op = new VetoableProperty<operatorType>(operatorType.class); 
	public final SingleChild<LapExpression> value = new SingleChild<>(this, LapExpression.class);
	
	public LapAugAssign(PyAST pyAST, ChildField<? super LapAugAssign> parent, AugAssign node) throws PropertyVetoException {
		super(pyAST, parent, node);
		
		ASTHelperFactory.makeHelper(pyAST, target, node.getInternalTarget());
		op.setInternal(node.getInternalOp());
		ASTHelperFactory.makeHelper(pyAST, value, node.getInternalValue());
		
		buildTextNodes(node);
	}
}
